#! /usr/bin/env python
#coding=utf-8
import time

class Log:
    
    def __init__(self):
        self.logfile = "./access.log"
        self.error = "./error.log"
        
    def WriteLog(self, acc):
        self.Write(self.logfile, acc)
        
    def WriteEro(self, er):
        self.Write(self.error, er)
        
    def Write(self, file, log):
        t = time.strftime('%Y-%m-%d  %H:%M:%S',time.localtime())
        self.lf = open(file, "a")
        self.lf.write(t+" "+log.encode('utf8')+" \n")
        self.lf.close()
    